feat(config): add dock configuration options and refactor border radius#549
feat(config): add dock configuration options and refactor border radius#549MiraiDevv wants to merge 2 commits into
Conversation
| /// optional dock length override as percent of output (0 = auto) | ||
| pub dock_length_percent: Option<u16>, | ||
| /// optional dock position override as percent of available space (0-100) | ||
| pub dock_position_percent: Option<u16>, |
There was a problem hiding this comment.
Wouldn't it be better not to have the dock_ prefix?
There was a problem hiding this comment.
Wouldn't it be better not to have the
dock_prefix?
Keeping the dock_ prefix here is intentional to reduce ambiguity.
The reasoning is as follows:
-
These options reside within CosmicPanelConfig, which describes both panels and docks.
-
Generic names like length_percent or position_percent would suggest they apply to any instance, whereas the
-
prefix clarifies they are exclusive overrides for the Dock.
-
It prevents future naming collisions if equivalent fields are introduced for Panels.
-
It assists with configuration serialization and compatibility, as the config file currently mixes common and specific fields.
But if you prefer, I can remove it.
| /// optional dock icon size override | ||
| pub dock_icon_size: Option<u16>, | ||
| /// optional dock corner radius override | ||
| pub dock_corner_radius: Option<u16>, |
There was a problem hiding this comment.
How does this differ from border_radius?
There was a problem hiding this comment.
dock_corner_radius acts as an optional override specifically for the Dock.
The logic is as follows:
Some: It overrides the value, ignoring border_radius for the background rendering and transition animations.
None: The default behavior is maintained, and the Dock continues to use border_radius.
It serves primarily for aesthetic customization, allowing the Dock to have a distinct shape from the global theme without affecting layout, padding, or input regions. For example, a user might want a floating dock with fully rounded corners (pill shape) while keeping a different border_radius for other panels.
This PR and these changes aim to make one of the most important components of the Cosmic Desktop Environment (DE) more flexible for users. I created a function to increase and decrease the dock size as desired, and also to allow it to increase in size as applications are opened.
In addition, several other changes were made to allow users more freedom, such as: changing the border radius as much as desired and positioning the dock anywhere at the bottom of the DE.
This functionality is linked to another one I needed to make in cosmic-settings, so the two will be mentioned together in the two PRs that will be opened.
The other PR in cosmic-settings that is directly linked to this one is this one: pop-os/cosmic-settings#1771
Any errors or criticism are welcome ; )